<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="error" uri="/WEB-INF/tags/ErrorTag.tld"%>

<t:basicTemplate
	pageTitle="SWIMv2 - ${userName} - Amministration Control Panel">
	<jsp:attribute name="extrahead">
		<link rel='stylesheet' href='css/plainform.css' type='text/css' />
		<link rel='stylesheet' href='css/administration.css' type='text/css' />
	</jsp:attribute>
	<jsp:body>
    	<h1>Amministration Page</h1>
    	<p> Wellcome ${userName}!</p>
    	<t:errorAndMessage message="${message}" />
		<div class="error-style">
			<error:errors error="${param.error}"></error:errors>
		</div>
		<div>
    		<h2>Banned users</h2>
    		<h3> List of banned users</h3>    		
    		<c:forEach var="banned" items="${bannedList}">
    		<ul>
    			<li>
    				<form id="sbanform" name="sban user" method="post"
							action="./proceedSbanUser">
    					<label for="passid">${banned}</label>
						<input type="hidden" name="sbanned" value="${banned}" />
						<input type="submit" name="submit" value="x" />
    				</form>
    			</li>
    		</ul>
    		</c:forEach>
    		
    	</div>
    	<div>
    		<h2>Ban user</h2>
    		<form name="ban user" method="post" action="./proceedBan">
    			<ul>
    				<li><label>User name</label></li>
    				<li><input type="text" name="userToBan" size="50" /></li>
    				<li><label>Days of Ban</label></li>
    				<li><input type="number" name="banDays" size="50" /></li>
    				<li><input type="submit" name="submit" value="Ban!" /></li>
    			</ul>
			</form>
		</div>
		
		<c:if test="${isFounder}">
			<%@include file="ChangeFounder.jsp"%>
			<%@include file="AdminManagement.jsp"%>
		</c:if>
		
    	
    </jsp:body>
</t:basicTemplate>